<template>
  <div id="app">
    <Header :seller='seller'></Header>
    <Tab></Tab>
    <keep-alive exclude="food">
      <router-view :seller="seller"></router-view>
    </keep-alive>
  </div>
</template>

<script>
import Header from 'components/header/header'
import Tab from 'components/tab/tab'
import axios from 'axios'
import {urlParse} from 'common/js/util'
export default {
  name: 'App',
  data() {
    return {
      seller: {
        id: (() =>{
          let queryParam = urlParse();
          return queryParam.id
        })()
      }
    }
  },
  components: {
    Header,
    Tab
  },
  methods: {
    getseller() {
      axios.get('/api/seller.json?id='+this.seller.id)
      .then(this.getsellerSucc)
    },
    getsellerSucc(res) {
      res=res.data
      if (res.ret && res) {
        const data = res
        this.seller = Object.assign({}, this.seller, data.seller);
      }
    }        
  },
  mounted() {
    this.getseller()
  }
}
</script>

<style>

</style>
